<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function (){
            var input = document.querySelector("input");
            // input.style.color = "red";
            input.value = "测试";
        }
    </script>
</head>
<body>
<input type="button" value="测试" style="color: green" onclick="test(this)">
</body>
</html>
